package com.edgclub.edg.uc;

import android.app.Dialog;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.WindowManager;
import android.widget.CheckBox;
import android.widget.CompoundButton;
import android.widget.ImageView;
import android.widget.TextView;

import com.edgclub.edg.R;

/**
 * 确定取消的对话框
 * 
 * @author 陈坤彬
 *
 */
public class YueHeiDialog1 extends Dialog {

	private TextView title;
	private TextView content;
	private TextView tvOk;
	private CheckBox agree;
	private Context context;

	private Dialog dialog;

	private SubmitClickListener onSubmitClickListener;

	private YueHeiDialog1 instance;

	private ImageView line;


	public static YueHeiDialog1 create(Context context, boolean hasCancle) {
		YueHeiDialog1 instance = new YueHeiDialog1(context, hasCancle);
		return instance;

	}

	private YueHeiDialog1(Context context, boolean hasCancle) {
		super(context, R.style.MyAlertDialog);
		init(context, hasCancle);
	}

	private void init(Context context, boolean hasCancle) {
		this.context = context;
		WindowManager.LayoutParams lp = new WindowManager.LayoutParams();
		lp.width = context.getResources().getDisplayMetrics().widthPixels;
		View contentView = LayoutInflater.from(context).inflate(
				R.layout.layout_yuehei_dialog1, null);
		setContentView(contentView, lp);
		line = (ImageView) contentView.findViewById(R.id.line);
		tvOk = (TextView) contentView.findViewById(R.id.tv_ok);
		title = (TextView) contentView.findViewById(R.id.tv_title);
		content = (TextView) contentView.findViewById(R.id.tv_content);
	}
	/**
	 * 设置确认的监听
	 */
	public void setSubmitListener(
			final SubmitClickListener onSubmitClickListener) {
		tvOk.setOnClickListener(new View.OnClickListener() {

			@Override
			public void onClick(View view) {
				if (null != onSubmitClickListener) {
					onSubmitClickListener.submitClick();
				}
			}
		});
	}


	public interface SubmitClickListener {
		public void submitClick();

	}

	public interface CancelClickListener {
		public void cancelClick(boolean b);
	}


	

}
